package com.ruoyi.procurementmanagement.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 采购订单跟踪表对象 es_pur_order
 *
 * @author ruoyi
 * @date 2025-05-08
 */
public class EsPurOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 采购订单ID */
    private Long orderId;

    /** 订单编号 */
    @Excel(name = "订单编号")
    private String orderNs;

    /** 状态 */
    @Excel(name = "状态")
    private String status;

    /** 总金额 */
    @Excel(name = "总金额")
    private BigDecimal amount;

    /** 供应商ID */
    @Excel(name = "供应商ID")
    private Long supplierId;

    /** 供应商名称 */
    @Excel(name = "供应商名称")
    private String supplierName;

    /** 采购合同ID */
    @Excel(name = "采购合同ID")
    private Long contractId;

    /** 采购计划ID */
    @Excel(name = "采购计划ID")
    private Long planId;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date date;

    // 添加合同关联
    private EsProcurementContract procurementContract;

    // 添加入库单关联
    private ErpWarehouseEntry warehouseEntry;

    private EsProcurementPlan procurementPlan;

    private List<EsProcurementContractProduct> contractProducts;

    public void setOrderId(Long orderId)
    {
        this.orderId = orderId;
    }

    public Long getOrderId()
    {
        return orderId;
    }
    public void setOrderNs(String orderNs)
    {
        this.orderNs = orderNs;
    }

    public String getOrderNs()
    {
        return orderNs;
    }
    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }
    public void setAmount(BigDecimal amount)
    {
        this.amount = amount;
    }

    public BigDecimal getAmount()
    {
        return amount;
    }
    public void setSupplierId(Long supplierId)
    {
        this.supplierId = supplierId;
    }

    public Long getSupplierId()
    {
        return supplierId;
    }
    public void setSupplierName(String supplierName)
    {
        this.supplierName = supplierName;
    }

    public String getSupplierName()
    {
        return supplierName;
    }
    public void setContractId(Long contractId)
    {
        this.contractId = contractId;
    }

    public Long getContractId()
    {
        return contractId;
    }
    public void setPlanId(Long planId)
    {
        this.planId = planId;
    }

    public Long getPlanId()
    {
        return planId;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public EsProcurementContract getProcurementContract() {
        return procurementContract;
    }

    public void setProcurementContract(EsProcurementContract procurementContract) {
        this.procurementContract = procurementContract;
    }

    public ErpWarehouseEntry getWarehouseEntry() {
        return warehouseEntry;
    }

    public void setWarehouseEntry(ErpWarehouseEntry warehouseEntry) {
        this.warehouseEntry = warehouseEntry;
    }

    public List<EsProcurementContractProduct> getContractProducts() {
        return contractProducts;
    }

    public void setContractProducts(List<EsProcurementContractProduct> contractProducts) {
        this.contractProducts = contractProducts;
    }

    public EsProcurementPlan getProcurementPlan() {
        return procurementPlan;
    }

    public void setProcurementPlan(EsProcurementPlan procurementPlan) {
        this.procurementPlan = procurementPlan;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("orderId", getOrderId())
            .append("orderNs", getOrderNs())
            .append("status", getStatus())
            .append("amount", getAmount())
            .append("supplierId", getSupplierId())
            .append("supplierName", getSupplierName())
            .append("contractId", getContractId())
            .append("planId", getPlanId())
            .append("date", getDate())
                .append("procurementContract", getProcurementContract())
                .append("warehouseEntry", getWarehouseEntry())
                .append("contractProducts", getContractProducts())
                .append("procurementPlan", getProcurementPlan())
            .toString();
    }
}
